package com.push_label.server;

import com.push_label.bean.customer.CustomerInfo;
import com.push_label.mapper.CustomerMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;

@Service
@Slf4j
public class CustomerServiceImpl implements CustomerService {

    @Resource
    private CustomerMapper customerMapper;

    @Override
    @Cacheable(cacheNames = "customer",key = "'all'" ,unless = "#result == null")
    public List<CustomerInfo> selectAllCustomerInfo() {
        return customerMapper.selectAllCustomerInfo();
    }
}
